#include "MonocularOperatorNode.h"

#include "Output/Console.h"
#include "ScriptCompiler/Token/Token.h"



void CMonocularOperatorNode::DebugPrint(int32_t InDepth)
{
    //print depth
    for (int32_t i = 0; i < InDepth; i++)
    {
        WH::Print(U"\t");
    }

    if(bRight)
    {
        //print operand
        Operand->DebugPrint(0);

        //print operator
        WH::Print(Operator->ToString());
    }
    else 
    {

        //print operator
        WH::Print(Operator->ToString());

        //print operand
        Operand->DebugPrint(0);
    }

}

std::shared_ptr<CScriptToken> CMonocularOperatorNode::GetFirstToken()
{
    if(bRight)
    {
        return Operand->GetFirstToken();
    }
    else    
    {
        return Operator;
    }
}
